// /* type Person = {
//   age:number,
//   name: string,
//   alive:boolean
// }

// type Age = Person['age']

// let age:Age = '90' */

// interface Person {
//   name: string,
//   age: number,
//   alive: boolean
// }

// //Type I1 = string | name
// type I1 = Person['age' | 'name']
// const I11:I1 = 100
// const I12:I1 = '222'
// /* const I13:I1 = true */

// //type I2 = string | number | boolean
// type I2 = Person [keyof Person]
// const I21: I2 = ''
// const I22: I2 = 100
// const I23: I2 = true
// // const I24: I2 = {}

// type AliveOrName = 'alive' | 'name'
// type I3 = Person[AliveOrName]
// const I31:I3 = true
// const I32:I3 = 'HELLO'
/* const I33:I3 = 100 */

/* type I4 = Person['alve'] */

const MyArray = [
  { name: 'Alice', age:15 },
  { name: 'Bob', age:23 },
  { name: 'Eve', age:38 },
]

//type Person = { name: string, age: number}
type Person = typeof MyArray[number]
const p: Person = {
  name:'xiaoqian',
  age:11,
  //alive:true
}

type Age = typeof MyArray[number]['age']
const age: Age = 11

type Age2 = Person['age']
const age2: Age2 = 300

/* const key = 'age' */
type key = 'age'
/* type Age3 = Person[typeof key] */
type Age3 = Person[key]